﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="Products.aspx.cs" Inherits="Admin_Products" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxHtmlEditor.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxHtmlEditor" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxSpellChecker.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxSpellChecker" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="featured-post">
        <h2>Quản lý thông tin sách</h2>
        <asp:SqlDataSource ID="_sdsProducts" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:DB_BookStoreConnectionString %>" 
            DeleteCommand="DELETE FROM [Products] WHERE [ProductID] =  @original_ProductID" 
            InsertCommand="INSERT INTO [Products] ([ProductName], [CategoryID], [AuthorID], [PublisherID], [Price], [SaleOff], [Thumbnail], [Image], [Language], [AddingDate], [Amount], [Description]) VALUES (@ProductName, @CategoryID, @AuthorID, @PublisherID, @Price, @SaleOff, @Thumbnail, @Image, @Language, @AddingDate, @Amount, @Description)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [Products]" 
            
            
            
            UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName, [CategoryID] = @CategoryID, [AuthorID] = @AuthorID, [PublisherID] = @PublisherID, [Price] = @Price, [SaleOff] = @SaleOff, [Thumbnail] = @Thumbnail, [Image] = @Image, [Language] = @Language, [AddingDate] = @AddingDate, [Amount] = @Amount, [Description] = @Description WHERE [ProductID] = @original_ProductID AND [ProductName] = @original_ProductName AND (([CategoryID] = @original_CategoryID) OR ([CategoryID] IS NULL AND @original_CategoryID IS NULL)) AND (([AuthorID] = @original_AuthorID) OR ([AuthorID] IS NULL AND @original_AuthorID IS NULL)) AND (([PublisherID] = @original_PublisherID) OR ([PublisherID] IS NULL AND @original_PublisherID IS NULL)) AND (([Price] = @original_Price) OR ([Price] IS NULL AND @original_Price IS NULL)) AND (([SaleOff] = @original_SaleOff) OR ([SaleOff] IS NULL AND @original_SaleOff IS NULL)) AND (([Thumbnail] = @original_Thumbnail) OR ([Thumbnail] IS NULL AND @original_Thumbnail IS NULL)) AND (([Image] = @original_Image) OR ([Image] IS NULL AND @original_Image IS NULL)) AND (([Language] = @original_Language) OR ([Language] IS NULL AND @original_Language IS NULL)) AND (([AddingDate] = @original_AddingDate) OR ([AddingDate] IS NULL AND @original_AddingDate IS NULL)) AND (([Amount] = @original_Amount) OR ([Amount] IS NULL AND @original_Amount IS NULL)) AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_ProductID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ProductName" Type="String" />
                <asp:Parameter Name="CategoryID" Type="Int32" />
                <asp:Parameter Name="AuthorID" Type="Int32" />
                <asp:Parameter Name="PublisherID" Type="Int32" />
                <asp:Parameter Name="Price" Type="Double" />
                <asp:Parameter Name="SaleOff" Type="Double" />
                <asp:Parameter Name="Thumbnail" Type="String" />
                <asp:Parameter Name="Image" Type="String" />
                <asp:Parameter Name="Language" Type="String" />
                <asp:Parameter Name="AddingDate" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="original_ProductID" Type="Int32" />
                <asp:Parameter Name="original_ProductName" Type="String" />
                <asp:Parameter Name="original_CategoryID" Type="Int32" />
                <asp:Parameter Name="original_AuthorID" Type="Int32" />
                <asp:Parameter Name="original_PublisherID" Type="Int32" />
                <asp:Parameter Name="original_Price" Type="Double" />
                <asp:Parameter Name="original_SaleOff" Type="Double" />
                <asp:Parameter Name="original_Thumbnail" Type="String" />
                <asp:Parameter Name="original_Image" Type="String" />
                <asp:Parameter Name="original_Language" Type="String" />
                <asp:Parameter Name="original_AddingDate" Type="String" />
                <asp:Parameter Name="original_Amount" Type="Int32" />
                <asp:Parameter Name="original_Description" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ProductName" Type="String" />
                <asp:Parameter Name="CategoryID" Type="Int32" />
                <asp:Parameter Name="AuthorID" Type="Int32" />
                <asp:Parameter Name="PublisherID" Type="Int32" />
                <asp:Parameter Name="Price" Type="Double" />
                <asp:Parameter Name="SaleOff" Type="Double" />
                <asp:Parameter Name="Thumbnail" Type="String" />
                <asp:Parameter Name="Image" Type="String" />
                <asp:Parameter Name="Language" Type="String" />
                <asp:Parameter Name="AddingDate" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="Description" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="_sdsCategories" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DB_BookStoreConnectionString %>" 
            SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="_sdsPublishers" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DB_BookStoreConnectionString %>" 
            SelectCommand="SELECT [PublisherID], [PublisherName], [Logo] FROM [Publishers]">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="_sdsAuthors" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DB_BookStoreConnectionString %>" 
            SelectCommand="SELECT [AuthorID], [AuthorName], [Image] FROM [Authors]">
        </asp:SqlDataSource>
        <asp:MultiView ID="MultiView1" runat="server">
            <asp:View ID="View1" runat="server">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataKeyNames="ProductID" 
                    DataSourceID="_sdsProducts">
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <EditItemTemplate>
                                &nbsp;
                                <asp:LinkButton ID="LinkButton5" runat="server" CommandName="Update">Update</asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton6" runat="server" CommandName="Cancel">Cancel</asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                    CommandName="Delete" Text="Delete"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ProductID" HeaderText="ProductID" 
                            InsertVisible="False" ReadOnly="True" SortExpression="ProductID" />
                        <asp:TemplateField HeaderText="ProductName" SortExpression="ProductName">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("ProductName") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton4" runat="server" 
                                    CommandArgument='<%# Bind("ProductID") %>' 
                                    Text='<%# Bind("ProductName") %>' 
                                    PostBackUrl='<%# Eval("ProductID", "Products.aspx?action=edit&id={0}") %>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="CategoryID" SortExpression="CategoryID">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList1" runat="server" 
                                    DataSourceID="_sdsCategories" DataTextField="CategoryName" 
                                    DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="DropDownList1" runat="server" 
                                    DataSourceID="_sdsCategories" DataTextField="CategoryName" 
                                    DataValueField="CategoryID" Enabled="False" 
                                    SelectedValue='<%# Bind("CategoryID") %>'>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="AuthorID" SortExpression="AuthorID">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="_sdsAuthors" 
                                    DataTextField="AuthorName" DataValueField="AuthorID" 
                                    SelectedValue='<%# Bind("AuthorID") %>'>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="_sdsAuthors" 
                                    DataTextField="AuthorName" DataValueField="AuthorID" Enabled="False" 
                                    SelectedValue='<%# Bind("AuthorID") %>'>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="PublisherID" SortExpression="PublisherID">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList3" runat="server" 
                                    DataSourceID="_sdsPublishers" DataTextField="PublisherName" 
                                    DataValueField="PublisherID" SelectedValue='<%# Bind("PublisherID") %>'>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="DropDownList3" runat="server" 
                                    DataSourceID="_sdsPublishers" DataTextField="PublisherName" 
                                    DataValueField="PublisherID" Enabled="False" 
                                    SelectedValue='<%# Bind("PublisherID") %>'>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
                        <asp:BoundField DataField="SaleOff" HeaderText="SaleOff" 
                            SortExpression="SaleOff" />
                        <asp:TemplateField HeaderText="Thumbnail" SortExpression="Thumbnail">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Thumbnail") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Image ID="Image1" runat="server" Height="60px" 
                                    ImageUrl='<%# Eval("Thumbnail") %>' Width="63px" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Image" SortExpression="Image">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Image ID="Image2" runat="server" Height="66px" 
                                    ImageUrl='<%# Eval("Image") %>' Width="65px" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Language" HeaderText="Language" 
                            SortExpression="Language" />
                        <asp:BoundField DataField="AddingDate" HeaderText="AddingDate" 
                            SortExpression="AddingDate" />
                    </Columns>
                    <PagerTemplate>
                        <br />
                        &nbsp;
                    </PagerTemplate>
                </asp:GridView>
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="New" 
                    PostBackUrl="~/Admin/Products.aspx?action=insert">New</asp:LinkButton>
                &nbsp;<br />
            </asp:View>
            <asp:View ID="View2" runat="server">
                <asp:FormView ID="FormView1" runat="server" BackColor="LightGoldenrodYellow" 
                    BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="ProductID" 
                    DataSourceID="SqlDataSource1" ForeColor="Black" Width="648px" 
                    DefaultMode="Insert">
                    <FooterStyle BackColor="Tan" />
                    <EditItemTemplate>
                        <table>
                            <tr>
                                <td colspan="3">
                                    <h3> Thông tin sản phẩm </h3>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Tên sản phẩm</p></td>
                                <td>
                                    <asp:TextBox ID="ProductNameTextBox" runat="server" 
                                        Text='<%# Bind("ProductName") %>' Width="150px" />
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="ProductNameTextBox" ErrorMessage="*" SetFocusOnError="True">Bắt buộc</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Thể loại</p></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList5" runat="server" 
                                        DataSourceID="_sdsCategories" DataTextField="CategoryName" 
                                        DataValueField="CategoryID" 
                                        SelectedValue='<%# Bind("CategoryID") %>' Width="150px">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Tác giả</p></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList6" runat="server" DataSourceID="_sdsAuthors" 
                                        DataTextField="AuthorName" DataValueField="AuthorID" 
                                        SelectedValue='<%# Bind("AuthorID") %>' Width="150px">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Nhà xuất bản</p></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList7" runat="server" 
                                        DataSourceID="_sdsPublishers" DataTextField="PublisherName" 
                                        DataValueField="PublisherID" 
                                        SelectedValue='<%# Bind("PublisherID") %>' Width="150px">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Giá bìa</p></td>
                                <td>
                                    <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="PriceTextBox" ErrorMessage="*">Bắt buộc</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Giá giảm</p></td>
                                <td>
                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("SaleOff") %>'></asp:TextBox>
                                </td>
                                <td>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                        ControlToCompare="PriceTextBox" ControlToValidate="TextBox7" 
                                        ErrorMessage="*" Operator="LessThanEqual" 
                                        SetFocusOnError="True" Type="Integer">Giảm giảm nhỏ hơn hoặc bằng giá thật</asp:CompareValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ảnh nhỏ</p></td>
                                <td>
                                    <asp:TextBox ID="ThumbnailTextBox" runat="server" Text='<%# Bind("Thumbnail") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ảnh lớn</p></td>
                                <td>
                                    <asp:TextBox ID="ImageTextBox" runat="server" Text='<%# Bind("Image") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ngôn ngữ</p></td>
                                <td>
                                    <asp:TextBox ID="LanguageTextBox" runat="server" Text='<%# Bind("Language") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ngày thêm</p></td>
                                <td>
                                    <dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server" 
                                        Value='<%# Bind("AddingDate") %>' Width="150px" CssClass="FloatLeft">
                                    </dx:ASPxDateEdit>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <h3>Mô tả:</h3></td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server" 
                                        Html='<%# Bind("Description") %>'>
                                        <SettingsImageSelector>
                                            <CommonSettings AllowedFileExtensions=".jpe, .jpeg, .jpg, .gif, .png" />
                                        </SettingsImageSelector>
                                        <SettingsImageUpload>
                                            <ValidationSettings AllowedFileExtensions=".jpe, .jpeg, .jpg, .gif, .png">
                                            </ValidationSettings>
                                        </SettingsImageUpload>
                                    </dx:ASPxHtmlEditor>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update" PostBackUrl="Products.aspx" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" 
                            PostBackUrl="Products.aspx" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <table>
                            <tr>
                                <td colspan="3">
                                    <h3> Thông tin sản phẩm </h3>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Tên sản phẩm</p></td>
                                <td>
                                    <asp:TextBox ID="ProductNameTextBox" runat="server" 
                                        Text='<%# Bind("ProductName") %>' Width="150px" />
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="ProductNameTextBox" ErrorMessage="*" SetFocusOnError="True">Bắt buộc</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Thể loại</p></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList5" runat="server" 
                                        DataSourceID="_sdsCategories" DataTextField="CategoryName" 
                                        DataValueField="CategoryID" 
                                        SelectedValue='<%# Bind("CategoryID") %>' Width="150px">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Tác giả</p></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList6" runat="server" DataSourceID="_sdsAuthors" 
                                        DataTextField="AuthorName" DataValueField="AuthorID" 
                                        SelectedValue='<%# Bind("AuthorID") %>' Width="150px">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Nhà xuất bản</p></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList7" runat="server" 
                                        DataSourceID="_sdsPublishers" DataTextField="PublisherName" 
                                        DataValueField="PublisherID" 
                                        SelectedValue='<%# Bind("PublisherID") %>' Width="150px">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Giá bìa</p></td>
                                <td>
                                    <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="PriceTextBox" ErrorMessage="*">Bắt buộc</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Giá giảm</p></td>
                                <td>
                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("SaleOff") %>'></asp:TextBox>
                                </td>
                                <td>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                        ControlToCompare="PriceTextBox" ControlToValidate="TextBox7" 
                                        ErrorMessage="*" Operator="LessThanEqual" 
                                        SetFocusOnError="True" Type="Integer">Giảm giảm nhỏ hơn hoặc bằng giá thật</asp:CompareValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ảnh nhỏ</p></td>
                                <td>
                                    <asp:TextBox ID="ThumbnailTextBox" runat="server" Text='<%# Bind("Thumbnail") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ảnh lớn</p></td>
                                <td>
                                    <asp:TextBox ID="ImageTextBox" runat="server" Text='<%# Bind("Image") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ngôn ngữ</p></td>
                                <td>
                                    <asp:TextBox ID="LanguageTextBox" runat="server" Text='<%# Bind("Language") %>' 
                                        Width="150px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <p>Ngày thêm</p></td>
                                <td>
                                    <dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server" 
                                        Value='<%# Bind("AddingDate") %>' Width="150px" CssClass="FloatLeft">
                                    </dx:ASPxDateEdit>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <h3>Mô tả:</h3></td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server" 
                                        Html='<%# Bind("Description") %>'>
                                        <SettingsImageSelector>
                                            <CommonSettings AllowedFileExtensions=".jpe, .jpeg, .jpg, .gif, .png" />
                                        </SettingsImageSelector>
                                        <SettingsImageUpload>
                                            <ValidationSettings AllowedFileExtensions=".jpe, .jpeg, .jpg, .gif, .png">
                                            </ValidationSettings>
                                        </SettingsImageUpload>
                                    </dx:ASPxHtmlEditor>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="Insert" PostBackUrl="Products.aspx" />
&nbsp;                  <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancel" PostBackUrl="Products.aspx" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <table class="style6">
                            <tr>
                                <td>
                                    ProductID:
                                </td>
                                <td>
                                    <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    ProductName:</td>
                                <td>
                                    <asp:Label ID="ProductNameLabel" runat="server" 
                                        Text='<%# Bind("ProductName") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    CategoryID:</td>
                                <td>
                                    <asp:Label ID="CategoryIDLabel" runat="server" 
                                        Text='<%# Bind("CategoryID") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    AuthorID:</td>
                                <td>
                                    <asp:Label ID="AuthorIDLabel" runat="server" Text='<%# Bind("AuthorID") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    PublisherID:
                                </td>
                                <td>
                                    <asp:Label ID="PublisherIDLabel" runat="server" 
                                        Text='<%# Bind("PublisherID") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Price:</td>
                                <td>
                                    <asp:Label ID="PriceLabel" runat="server" Text='<%# Bind("Price") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    SaleOff:
                                </td>
                                <td>
                                    <asp:Label ID="SaleOffLabel" runat="server" Text='<%# Bind("SaleOff") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Thumbnail:
                                </td>
                                <td>
                                    <asp:Label ID="ThumbnailLabel" runat="server" Text='<%# Bind("Thumbnail") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Image:
                                </td>
                                <td>
                                    <asp:Label ID="ImageLabel" runat="server" Text='<%# Bind("Image") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Language:
                                </td>
                                <td>
                                    <asp:Label ID="LanguageLabel" runat="server" Text='<%# Bind("Language") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    AddingDate:
                                </td>
                                <td>
                                    <asp:Label ID="AddingDateLabel" runat="server" 
                                        Text='<%# Bind("AddingDate") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Mô tả sản phẩm</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                        <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit" />
                        &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete" />
                        &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                            CommandName="New" Text="New" />
                    </ItemTemplate>
                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                        HorizontalAlign="Center" />
                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                    <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                </asp:FormView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConflictDetection="CompareAllValues" 
                    ConnectionString="<%$ ConnectionStrings:DB_BookStoreConnectionString %>" 
                    DeleteCommand="DELETE FROM [Products] WHERE [ProductID] = @original_ProductID" 
                    InsertCommand="INSERT INTO [Products] ([ProductName], [CategoryID], [AuthorID], [PublisherID], [Price], [SaleOff], [Thumbnail], [Image], [Language], [AddingDate], [Amount], [Description]) VALUES (@ProductName, @CategoryID, @AuthorID, @PublisherID, @Price, @SaleOff, @Thumbnail, @Image, @Language, @AddingDate, @Amount, @Description)" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectCommand="SELECT * FROM [Products] WHERE ([ProductID] = @ProductID)" 
                    
                    UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName, [CategoryID] = @CategoryID, [AuthorID] = @AuthorID, [PublisherID] = @PublisherID, [Price] = @Price, [SaleOff] = @SaleOff, [Thumbnail] = @Thumbnail, [Image] = @Image, [Language] = @Language, [AddingDate] = @AddingDate, [Amount] = @Amount, [Description] = @Description WHERE [ProductID] = @original_ProductID">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="ProductID" QueryStringField="id" Type="Int32" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="original_ProductID" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="ProductName" Type="String" />
                        <asp:Parameter Name="CategoryID" Type="Int32" />
                        <asp:Parameter Name="AuthorID" Type="Int32" />
                        <asp:Parameter Name="PublisherID" Type="Int32" />
                        <asp:Parameter Name="Price" Type="Double" />
                        <asp:Parameter Name="SaleOff" Type="Double" />
                        <asp:Parameter Name="Thumbnail" Type="String" />
                        <asp:Parameter Name="Image" Type="String" />
                        <asp:Parameter Name="Language" Type="String" />
                        <asp:Parameter Name="AddingDate" Type="String" />
                        <asp:Parameter Name="Amount" Type="Int32" />
                        <asp:Parameter Name="Description" Type="String" />
                        <asp:Parameter Name="original_ProductID" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="ProductName" Type="String" />
                        <asp:Parameter Name="CategoryID" Type="Int32" />
                        <asp:Parameter Name="AuthorID" Type="Int32" />
                        <asp:Parameter Name="PublisherID" Type="Int32" />
                        <asp:Parameter Name="Price" Type="Double" />
                        <asp:Parameter Name="SaleOff" Type="Double" />
                        <asp:Parameter Name="Thumbnail" Type="String" />
                        <asp:Parameter Name="Image" Type="String" />
                        <asp:Parameter Name="Language" Type="String" />
                        <asp:Parameter Name="AddingDate" Type="String" />
                        <asp:Parameter Name="Amount" Type="Int32" />
                        <asp:Parameter Name="Description" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </asp:View>
        </asp:MultiView>
    </div><!--End .#featured-post-->
</asp:Content>

